<script lang="ts" setup>
const props = defineProps<{
  imgs: string | string[]
}>()
const srcList = computed(() => {
  if (typeof props.imgs == 'string') {
    return props.imgs.split(',')
  }
  return props.imgs
})
const visible = ref(false)
</script>
<template>
  <div class="buttons">
    <a-button type="primary" v-if="props.imgs" @click="visible = true">查看</a-button>
    <span v-else>-</span>
    <a-image-preview-group v-model:visible="visible" infinite :srcList="srcList" />
  </div>
</template>
<style lang="less" scoped></style>
